home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
050a.dms
/
050a.adf
/
TEXTS
/
chapter02.txt
< prev
next >
Wrap
Text File
|
1992-02-26
|
3KB
|
66 lines
The Absolute Beginners Guide To Amos
-------------------------------------
Chapter Two
-----------
Before we continue on to more commands there are a few things I would like
to explain in this chapter.
The program in EXAMPLE1.Amos used seven lines for the actual code as we
should now understand these commands it would be nice to squash them all
up on one line. We can do this easily by using a colon (:) between each
command like this:
CURS OFF: HIDE: PAPER 0: CLS 0: PRINT "Testing...": WAIT KEY: EDIT
This will work exactly the same as the program in Example1.Amos.
This is not regarded as good programming practice by purists as it can make
long programs run a frame or two slower and can make listings a bit
confusing to follow but the choice is yours. Personally I have no preference
either way.
Something else you will have come across is the REM statement. REM is short
for REMark and serves as a good description of it's use. As Amos ignores
ANYTHING after a REM you can use it to put REMarks and comments in your
program listings.
REM tells Amos not to bother about the rest of that particular line
For example:
REM I can put want I want here with no worries
You can even use REM at the end of a line of instructions like this:
CURS OFF: REM wibble wibble rhubarb
But you cannot do this:
CURS OFF: REM CLS 0
Well you can do it, but Amos will never execute the CLS 0 command, it will
think CLS 0 is a comment of yours.
If you are not impressed with REM then you can use ` instead:
` I can put anything I want here with no worries
But you cannot use an apostrophe like this
CURS OFF ` this will cause a syntax error
CURS OFF: 'So will this! :CLS 3
What you may ask is all the fuss about REM and ` as they don`t seem to do a
lot? Well, just observe my program comments in the examples and it will be
clear how useful commenting a program can be, especially in complex programs
where you have to keep track of lots of variables, ha! That is a nice link
to chapter three where we learn about variables amongst other things.
Time to LOAD up EXAMPLE2.Amos and mess around with the listing. Although
it's the same boring program as Example1.Amos I urge you to take a quick
peek, just to make everything very clear in your mind.
Don`t forget to take notes on everything you learn.
End of chapter two
^^^^^^^^^^^^^^^^^^